home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / WindowsLookAndFeel.java < prev    next >
Text File  |  1998-06-30  |  23KB  |  514 lines

  1. /*
  2.  * @(#)WindowsLookAndFeel.java    1.30 98/04/14
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf.windows;
  22.  
  23. import java.awt.*;
  24. import com.sun.java.swing.plaf.*;
  25. import com.sun.java.swing.*;
  26. import com.sun.java.swing.plaf.basic.*;
  27. import com.sun.java.swing.border.*;
  28. import com.sun.java.swing.text.JTextComponent;
  29. import com.sun.java.swing.text.DefaultEditorKit;
  30.  
  31. import java.awt.Font;
  32. import java.awt.Color;
  33. import java.awt.SystemColor;
  34. import java.awt.event.KeyEvent;
  35. import java.awt.event.InputEvent;
  36.  
  37. import java.net.URL;
  38. import java.io.Serializable;
  39.  
  40.  
  41. /**
  42.  * Implements the Windows95 Look and Feel.
  43.  * UI classes not implemented specifically for Windows will
  44.  * default to those implemented in Basic.  
  45.  * <p>
  46.  * For the keyboard keys defined for each component in this Look and
  47.  * Feel (L&F), see 
  48.  * <a href="../../doc-files/Key-Win32.html">Component Keystroke Actions for the Windows L&F</a>.
  49.  * <p>
  50.  * Warning: serialized objects of this class will not be compatible with
  51.  * future swing releases.  The current serialization support is appropriate
  52.  * for short term storage or RMI between Swing1.0 applications.  It will
  53.  * not be possible to load serialized Swing1.0 objects with future releases
  54.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  55.  * baseline for the serialized form of Swing objects.
  56.  *
  57.  * @version 1.30 04/14/98
  58.  * @author unknown
  59.  */
  60. public class WindowsLookAndFeel extends BasicLookAndFeel
  61. {
  62.     public String getName() {
  63.         return "Windows";
  64.     }
  65.  
  66.  
  67.     public String getDescription() {
  68.         return "The Microsoft Windows Look and Feel";
  69.     }
  70.  
  71.  
  72.     public String getID() {
  73.         return "Windows";
  74.     }
  75.     
  76.     public boolean isNativeLookAndFeel() {
  77.         String osName = System.getProperty("os.name");
  78.         return (osName != null) && (osName.indexOf("Windows") != -1);
  79.     }
  80.  
  81.  
  82.     public boolean isSupportedLookAndFeel() {
  83.     return isNativeLookAndFeel();
  84.     }
  85.  
  86.     
  87.     /** 
  88.      * Initialize the uiClassID to BasicComponentUI mapping.
  89.      * The JComponent classes define their own uiClassID constants
  90.      * (see AbstractComponent.getUIClassID).  This table must
  91.      * map those constants to a BasicComponentUI class of the
  92.      * appropriate type.
  93.      * 
  94.      * @see BasicLookAndFeel#getDefaults
  95.      */
  96.     protected void initClassDefaults(UIDefaults table)
  97.     {
  98.         String basicPackageName = "com.sun.java.swing.plaf.basic.";
  99.         String windowsPackageName = "com.sun.java.swing.plaf.windows.";
  100.         Object[] uiDefaults = {
  101.                    "ButtonUI", windowsPackageName + "WindowsButtonUI",
  102.                  "CheckBoxUI", windowsPackageName + "WindowsCheckBoxUI",
  103.              "ColorChooserUI", basicPackageName + "BasicColorChooserUI",
  104.                   "MenuBarUI", basicPackageName + "BasicMenuBarUI",
  105.                      "MenuUI", basicPackageName + "BasicMenuUI",
  106.                  "MenuItemUI", basicPackageName + "BasicMenuItemUI",
  107.          "CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
  108.       "RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
  109.               "RadioButtonUI", windowsPackageName + "WindowsRadioButtonUI",
  110.              "ToggleButtonUI", windowsPackageName + "WindowsToggleButtonUI",
  111.                 "PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
  112.               "ProgressBarUI", windowsPackageName + "WindowsProgressBarUI",
  113.                 "ScrollBarUI", basicPackageName + "BasicScrollBarUI",
  114.                "ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
  115.                 "SplitPaneUI", windowsPackageName + "WindowsSplitPaneUI",
  116.                    "SliderUI", basicPackageName + "BasicSliderUI",
  117.                   "SpinnerUI", basicPackageName + "BasicSpinnerUI",
  118.                 "SeparatorUI", basicPackageName + "BasicSeparatorUI",
  119.                "TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
  120.                  "TextAreaUI", windowsPackageName + "WindowsTextAreaUI",
  121.                 "TextFieldUI", windowsPackageName + "WindowsTextFieldUI",
  122.             "PasswordFieldUI", windowsPackageName + "WindowsPasswordFieldUI",
  123.                  "TextPaneUI", windowsPackageName + "WindowsTextPaneUI",
  124.                "EditorPaneUI", windowsPackageName + "WindowsEditorPaneUI",
  125.                      "TreeUI", windowsPackageName + "WindowsTreeUI",
  126.                     "LabelUI", basicPackageName + "BasicLabelUI",
  127.                      "ListUI", basicPackageName + "BasicListUI",
  128.                   "ToolBarUI", basicPackageName + "BasicToolBarUI",
  129.                   "ToolTipUI", basicPackageName + "BasicToolTipUI",
  130.                  "ComboBoxUI", windowsPackageName + "WindowsComboBoxUI",
  131.                     "TableUI", basicPackageName + "BasicTableUI",
  132.               "TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
  133.             "InternalFrameUI", windowsPackageName + "WindowsInternalFrameUI",
  134.            "StandardDialogUI", basicPackageName + "BasicStandardDialogUI",
  135.               "DesktopPaneUI", windowsPackageName + "WindowsDesktopPaneUI",
  136.               "DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
  137.               "FileChooserUI", windowsPackageName + "WindowsFileChooserUI",
  138.                "OptionPaneUI", basicPackageName + "BasicOptionPaneUI"
  139.         };
  140.  
  141.         table.putDefaults(uiDefaults);
  142.     }
  143.  
  144.     /**
  145.      * Load the SystemColors into the defaults table.  The keys
  146.      * for SystemColor defaults are the same as the names of
  147.      * the public fields in SystemColor.  If the table is being
  148.      * created on a native Windows platform we use the SystemColor
  149.      * values, otherwise we create color objects whose values match
  150.      * the defaults Windows95 colors.
  151.      */
  152.     protected void initSystemColorDefaults(UIDefaults table)
  153.     {
  154.         String[] systemColors = {
  155.                 "desktop", "#005C5C", /* Color of the desktop background */
  156.           "activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
  157.       "activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
  158.     "activeCaptionBorder", "#C0C0C0", /* Border color for caption (title bar) window borders. */
  159.         "inactiveCaption", "#808080", /* Color for captions (title bars) when not active. */
  160.     "inactiveCaptionText", "#C0C0C0", /* Text color for text in inactive captions (title bars). */
  161.   "inactiveCaptionBorder", "#C0C0C0", /* Border color for inactive caption (title bar) window borders. */
  162.                  "window", "#FFFFFF", /* Default color for the interior of windows */
  163.            "windowBorder", "#000000", /* ??? */
  164.              "windowText", "#000000", /* ??? */
  165.                    "menu", "#C0C0C0", /* Background color for menus */
  166.        "menuPressedItemB", "#000080", /* LightShadow of menubutton highlight */ 
  167.        "menuPressedItemF", "#FFFFFF", /* Default color for foreground "text" in menu item */
  168.                "menuText", "#000000", /* Text color for menus  */
  169.                    "text", "#C0C0C0", /* Text background color */
  170.                "textText", "#000000", /* Text foreground color */
  171.           "textHighlight", "#000080", /* Text background color when selected */
  172.       "textHighlightText", "#FFFFFF", /* Text color when selected */
  173.        "textInactiveText", "#808080", /* Text color when disabled */
  174.                 "control", "#C0C0C0", /* Default color for controls (buttons, sliders, etc) */
  175.             "controlText", "#000000", /* Default color for text in controls */
  176.        "controlHighlight", "#FFFFFF", /* Specular highlight (opposite of the shadow) */
  177.      "controlLtHighlight", "#E0E0E0", /* Highlight color for controls */
  178.           "controlShadow", "#808080", /* Shadow color for controls */
  179.         "controlDkShadow", "#000000", /* Dark shadow color for controls */
  180.               "scrollbar", "#E0E0E0", /* Scrollbar background (usually the "track") */
  181.                    "info", "#FFFFE1", /* ??? */
  182.                "infoText", "#000000"  /* ??? */
  183.         };
  184.  
  185.         loadSystemColors(table, systemColors);
  186.     }
  187.  
  188.     protected void initComponentDefaults(UIDefaults table) 
  189.     {
  190.         super.initComponentDefaults( table );
  191.  
  192.         // *** Fonts
  193.         FontUIResource dialogPlain12 = new FontUIResource("Dialog", Font.PLAIN, 12);
  194.         FontUIResource serifPlain12 = new FontUIResource("Serif", Font.PLAIN, 12);
  195.         FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif", Font.PLAIN, 12);
  196.         FontUIResource monospacedPlain12 = new FontUIResource("Monospaced", Font.PLAIN, 12);
  197.  
  198.         // *** Colors
  199.         ColorUIResource red = new ColorUIResource(Color.red);
  200.         ColorUIResource black = new ColorUIResource(Color.black);
  201.         ColorUIResource white = new ColorUIResource(Color.white);
  202.         ColorUIResource yellow = new ColorUIResource(Color.yellow);
  203.         ColorUIResource gray = new ColorUIResource(Color.gray);
  204.         ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
  205.         ColorUIResource darkGray = new ColorUIResource(Color.darkGray);
  206.         ColorUIResource scrollBarTrack = new ColorUIResource(224, 224, 224);
  207.  
  208.     // ** Menu
  209.         ColorUIResource menuItemPressedBackground = new ColorUIResource(0,0,128);
  210.         ColorUIResource menuItemPressedForeground = new ColorUIResource(255,255,255);
  211.  
  212.         // *** Tree 
  213.         ColorUIResource treeSelection = new ColorUIResource(0, 0, 128);
  214.  
  215.         Object treeExpandedIcon = new UIDefaults.LazyValue() {
  216.             public Object createValue(UIDefaults table) {
  217.                 return WindowsTreeUI.ExpandedIcon.createExpandedIcon();
  218.             }
  219.         };
  220.  
  221.         Object treeCollapsedIcon = new UIDefaults.LazyValue() {
  222.             public Object createValue(UIDefaults table) {
  223.                 return WindowsTreeUI.CollapsedIcon.createCollapsedIcon();
  224.             }
  225.         };
  226.  
  227.     // *** Text
  228.  
  229.     JTextComponent.KeyBinding[] fieldBindings = {
  230.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, 
  231.                                  InputEvent.CTRL_MASK),
  232.                       DefaultEditorKit.copyAction),
  233.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, 
  234.                                  InputEvent.CTRL_MASK),
  235.                       DefaultEditorKit.pasteAction),
  236.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, 
  237.                                  InputEvent.CTRL_MASK),
  238.                       DefaultEditorKit.cutAction),
  239.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  240.                                  InputEvent.SHIFT_MASK),
  241.                       DefaultEditorKit.selectionBackwardAction),
  242.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  243.                                  InputEvent.SHIFT_MASK),
  244.                       DefaultEditorKit.selectionForwardAction),
  245.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  246.                                  InputEvent.CTRL_MASK),
  247.                       DefaultEditorKit.previousWordAction),
  248.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  249.                                  InputEvent.CTRL_MASK),
  250.                       DefaultEditorKit.nextWordAction),
  251.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  252.                                  InputEvent.CTRL_MASK | 
  253.                                  InputEvent.SHIFT_MASK),
  254.                       DefaultEditorKit.selectionPreviousWordAction),
  255.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  256.                                  InputEvent.CTRL_MASK |
  257.                                  InputEvent.SHIFT_MASK),
  258.                       DefaultEditorKit.selectionNextWordAction),
  259.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_A, 
  260.                                  InputEvent.CTRL_MASK),
  261.                       DefaultEditorKit.selectAllAction),
  262.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
  263.                       DefaultEditorKit.beginLineAction),
  264.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
  265.                       DefaultEditorKit.endLineAction),
  266.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 
  267.                                  InputEvent.SHIFT_MASK),
  268.                       DefaultEditorKit.selectionBeginLineAction),
  269.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 
  270.                                  InputEvent.SHIFT_MASK),
  271.                       DefaultEditorKit.selectionEndLineAction),
  272.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
  273.                       JTextField.notifyAction)
  274.     };
  275.  
  276.     JTextComponent.KeyBinding[] multilineBindings = {
  277.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_C, 
  278.                                  InputEvent.CTRL_MASK),
  279.                       DefaultEditorKit.copyAction),
  280.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_V, 
  281.                                  InputEvent.CTRL_MASK),
  282.                       DefaultEditorKit.pasteAction),
  283.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_X, 
  284.                                  InputEvent.CTRL_MASK),
  285.                       DefaultEditorKit.cutAction),
  286.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  287.                                  InputEvent.SHIFT_MASK),
  288.                       DefaultEditorKit.selectionBackwardAction),
  289.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  290.                                  InputEvent.SHIFT_MASK),
  291.                       DefaultEditorKit.selectionForwardAction),
  292.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  293.                                  InputEvent.CTRL_MASK),
  294.                       DefaultEditorKit.previousWordAction),
  295.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  296.                                  InputEvent.CTRL_MASK),
  297.                       DefaultEditorKit.nextWordAction),
  298.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 
  299.                                  InputEvent.CTRL_MASK | 
  300.                                  InputEvent.SHIFT_MASK),
  301.                       DefaultEditorKit.selectionPreviousWordAction),
  302.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 
  303.                                  InputEvent.CTRL_MASK |
  304.                                  InputEvent.SHIFT_MASK),
  305.                       DefaultEditorKit.selectionNextWordAction),
  306.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_A, 
  307.                                  InputEvent.CTRL_MASK),
  308.                       DefaultEditorKit.selectAllAction),
  309.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
  310.                       DefaultEditorKit.beginLineAction),
  311.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
  312.                       DefaultEditorKit.endLineAction),
  313.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 
  314.                                  InputEvent.SHIFT_MASK),
  315.                       DefaultEditorKit.selectionBeginLineAction),
  316.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 
  317.                                  InputEvent.SHIFT_MASK),
  318.                       DefaultEditorKit.selectionEndLineAction),
  319.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0),
  320.                       DefaultEditorKit.upAction),
  321.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
  322.                       DefaultEditorKit.downAction),
  323.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
  324.                       DefaultEditorKit.pageUpAction),
  325.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
  326.                       DefaultEditorKit.pageDownAction),
  327.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP,
  328.                                  InputEvent.SHIFT_MASK),
  329.                       DefaultEditorKit.selectionUpAction),
  330.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,
  331.                                  InputEvent.SHIFT_MASK),
  332.                       DefaultEditorKit.selectionDownAction),
  333.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
  334.                       DefaultEditorKit.insertBreakAction),
  335.         new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
  336.                       DefaultEditorKit.insertTabAction)
  337.     };
  338.  
  339.         // *** Buttons
  340.         Object buttonBorder = new UIDefaults.LazyValue() {
  341.           public Object createValue(UIDefaults table) {
  342.             return new BorderUIResource(new CompoundBorder(
  343.                                            WindowsBorderFactory.getButtonBorder(),
  344.                                            BasicMarginBorder.getMarginBorder()));
  345.           }
  346.         };
  347.  
  348.         Object buttonToggleBorder = new UIDefaults.LazyValue() {
  349.           public Object createValue(UIDefaults table) {
  350.             return new BorderUIResource(new CompoundBorder(
  351.                                       WindowsBorderFactory.getToggleButtonBorder(),
  352.                                       BasicMarginBorder.getMarginBorder()));
  353.           }
  354.         };
  355.  
  356.  
  357.         Object checkBoxIcon = new UIDefaults.LazyValue() {
  358.             public Object createValue(UIDefaults table) {
  359.                 return WindowsIconFactory.getCheckBoxIcon();
  360.             }
  361.         };
  362.  
  363.         Object radioButtonIcon = new UIDefaults.LazyValue() {
  364.             public Object createValue(UIDefaults table) {
  365.                 return WindowsIconFactory.getRadioButtonIcon();
  366.             }
  367.         };
  368.  
  369.  
  370.     // *** ProgressBar
  371.     Object progressBarBorder = new BorderUIResource(new CompoundBorder(
  372.         WindowsBorderFactory.getProgressBarBorder(),
  373.         new EmptyBorder(1,1,1,1)
  374.         ) );
  375.  
  376.  
  377.         // *** ToolTips
  378.         Object toolTipBorder = new UIDefaults.LazyValue() {
  379.             public Object createValue(UIDefaults table) {
  380.                 return BorderUIResource.getBlackLineBorderUIResource();
  381.             }
  382.         };
  383.  
  384.         Object radioButtonBorder = new UIDefaults.LazyValue() {
  385.           public Object createValue(UIDefaults table) {
  386.             return new BorderUIResource(new CompoundBorder(
  387.                                       WindowsBorderFactory.getRadioButtonBorder(),
  388.                                       BasicMarginBorder.getMarginBorder()));
  389.           }
  390.         };
  391.  
  392.         Object menuItemCheckIcon = new UIDefaults.LazyValue() {
  393.             public Object createValue(UIDefaults table) {
  394.                 return WindowsIconFactory.getMenuItemCheckIcon();
  395.             }
  396.         };
  397.  
  398.         Object menuItemArrowIcon = new UIDefaults.LazyValue() {
  399.             public Object createValue(UIDefaults table) {
  400.                 return WindowsIconFactory.getMenuItemArrowIcon();
  401.             }
  402.         };
  403.  
  404.         Object menuArrowIcon = new UIDefaults.LazyValue() {
  405.             public Object createValue(UIDefaults table) {
  406.                 return WindowsIconFactory.getMenuArrowIcon();
  407.             }
  408.         };
  409.  
  410.         Object menuMarginBorder = new UIDefaults.LazyValue() {
  411.             public Object createValue(UIDefaults table) {
  412.               // REMIND: should be in WindowsBorderFactory
  413.                 return new BorderUIResource(BasicMarginBorder.getMarginBorder());
  414.             }
  415.         };
  416.  
  417.         Object[] defaults = {
  418.         "TextField.keyBindings", fieldBindings,
  419.         "PasswordField.keyBindings", fieldBindings,
  420.         "TextArea.keyBindings", multilineBindings,
  421.         "TextPane.keyBindings", multilineBindings,
  422.         "EditorPane.keyBindings", multilineBindings,
  423.  
  424.             "Button.border", buttonBorder,
  425.             "Button.background", table.get("control"),
  426.             "Button.foreground", table.get("controlText"),
  427.             "Button.focus", table.get("controlText"),
  428.             "Button.font", dialogPlain12,
  429.             "Button.pressed", table.get("control"),
  430.  
  431.             "CheckBox.icon", checkBoxIcon,
  432.  
  433.             "Menu.border", menuMarginBorder,
  434.             "Menu.font", dialogPlain12,
  435.             "Menu.foreground", table.get("menuText"),
  436.             "Menu.background", table.get("menu"),
  437.             "Menu.pressedForeground", menuItemPressedForeground,
  438.             "Menu.pressedBackground", menuItemPressedBackground,
  439.             "Menu.arrowIcon", menuArrowIcon,
  440.  
  441.             "MenuItem.border", menuMarginBorder,
  442.             "MenuItem.font", dialogPlain12,
  443.             "MenuItem.foreground", table.get("menuText"),
  444.             "MenuItem.background", table.get("menu"),
  445.             "MenuItem.pressedForeground", menuItemPressedForeground,
  446.             "MenuItem.pressedBackground", menuItemPressedBackground,
  447.             "MenuItem.checkIcon", menuItemCheckIcon,
  448.             "MenuItem.arrowIcon", menuItemArrowIcon,
  449.  
  450.             "ToggleButton.border", buttonToggleBorder,
  451.             "ToggleButton.background", table.get("control"),
  452.             "ToggleButton.foreground", table.get("controlText"),
  453.             "ToggleButton.focus", table.get("controlText"),
  454.             "ToggleButton.font", dialogPlain12,
  455.  
  456.             "SplitPane.background", table.get("control"),
  457.             "SplitPane.highlight", table.get("controllHighlight"),
  458.             "SplitPane.shadow", table.get("controlShadow"),
  459.         "SplitPane.dividerSize", new Integer(3),
  460.  
  461.             "RadioButton.background", table.get("control"),
  462.             "RadioButton.foreground", table.get("controlText"),
  463.             "RadioButton.font", dialogPlain12,
  464.             "RadioButton.icon", radioButtonIcon,
  465.             "RadioButton.border", radioButtonBorder,
  466.             "RadioButton.focus", black,
  467.  
  468.             "ToolTip.font", sansSerifPlain12,
  469.             "ToolTip.border", toolTipBorder,
  470.             "ToolTip.background", table.get("info"),
  471.             "ToolTip.foreground", table.get("infoText"),
  472.  
  473.             "ProgressBar.font", dialogPlain12,
  474.             "ProgressBar.foreground",  table.get("textHighlight"), 
  475.             "ProgressBar.background", table.get("control"), 
  476.         "ProgressBar.border", progressBarBorder,
  477.             "ProgressBar.cellLength", new Integer(7),
  478.             "ProgressBar.cellSpacing", new Integer(2),
  479.  
  480.             "Tree.background", white,
  481.             "Tree.hash", gray,
  482.             "Tree.borderSelectionColor", yellow,
  483.             "Tree.backgroundSelectionColor", treeSelection,
  484.             "Tree.backgroundNonSelectionColor", white,
  485.             "Tree.expandedIcon", treeExpandedIcon,
  486.             "Tree.collapsedIcon", treeCollapsedIcon,
  487.  
  488.         "FileChooser.newFolderIcon", LookAndFeel.makeIcon(getClass(), "icons/NewFolder.gif"),
  489.         "FileChooser.upFolderIcon", LookAndFeel.makeIcon(getClass(), "icons/UpFolder.gif"),
  490.         "FileChooser.homeFolderIcon", LookAndFeel.makeIcon(getClass(), "icons/HomeFolder.gif"),
  491.         "FileChooser.detailsViewIcon", LookAndFeel.makeIcon(getClass(), "icons/DetailsView.gif"),
  492.         "FileChooser.listViewIcon", LookAndFeel.makeIcon(getClass(), "icons/ListView.gif"),
  493.  
  494.         "FileView.directoryIcon", LookAndFeel.makeIcon(getClass(), "icons/Directory.gif"),
  495.         "FileView.fileIcon", LookAndFeel.makeIcon(getClass(), "icons/File.gif"),
  496.         "FileView.computerIcon", LookAndFeel.makeIcon(getClass(), "icons/Computer.gif"),
  497.         "FileView.hardDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/HardDrive.gif"),
  498.         "FileView.floppyDriveIcon", LookAndFeel.makeIcon(getClass(), "icons/FloppyDrive.gif"),
  499.  
  500.             "InternalFrame.maximizeIcon", 
  501.                 WindowsIconFactory.createFrameMaximizeIcon(),
  502.             "InternalFrame.minimizeIcon", 
  503.                 WindowsIconFactory.createFrameMinimizeIcon(),
  504.             "InternalFrame.iconifyIcon", 
  505.                 WindowsIconFactory.createFrameIconifyIcon(),
  506.             "InternalFrame.closeIcon", 
  507.                 WindowsIconFactory.createFrameCloseIcon(),
  508.  
  509.         };
  510.  
  511.         table.putDefaults(defaults);
  512.     }
  513. }
  514.